import Vue from "vue";
import VueRouter from "vue-router";
import Home from "../views/Home.vue";

Vue.use(VueRouter);

const routes = [
  {
    path: "/",
    name: "Home",
    component: Home
  },
  {
    path: "/about",
    name: "About",
    // route level code-splitting
    // this generates a separate chunk (about.[hash].js) for this route
    // which is lazy-loaded when the route is visited.
    component: () =>
      import(/* webpackChunkName: "about" */ "../views/About.vue")
  },
  {
    path: "/login",
    name: "login",
    component: () => import("../views/login/index")
  },
  {
    path: "/register",
    name: "register",
    component: () => import("../views/register/index")
  },
  {
    path: "/userInfo",
    name: "userInfo",
    component: () => import("../views/userInfo/index")
  },
  {
    path: "/areaManage",
    name: "areaManage",
    component: () => import("../views/areaManage/index")
  },
  {
    path: "/schoolManage",
    name: "schoolManage",
    component: () => import("../views/schoolManage/index")
  },
  {
    path: "/userManage",
    name: "/userManage",
    component: () => import("../views/userManage/index")
  },
  {
    path: "/roleManage",
    name: "/roleManage",
    component: () => import("../views/roleManage/index")
  },
  {
    path: "/authManage",
    name: "/authManage",
    component: () => import("../views/authManage/index")
  },
  {
    path: "/houseManage",
    name: "/houseManage",
    component: () => import("../views/houseManage/index")
  },
  {
    path: "/commentManage",
    name: "/commentManage",
    component: () => import("../views/commentManage/index")
  },
  {
    path: "/askManage",
    name: "/askManage",
    component: () => import("../views/askManage/index")
  },
  {
    path: "/leaseManage",
    name: "/leaseManage",
    component: () => import("../views/leaseManage/index")
  },
  {
    path: "/houseShops",
    name: "/houseShops",
    component: () => import("../views/houseShops/index")
  },
  {
    path: "/houseMyManage",
    name: "/houseMyManage",
    component: () => import("../views/houseMyManage/index")
  },
  {
    path: "/askMyManage",
    name: "/askMyManage",
    component: () => import("../views/askMyManage/index")
  },
  {
    path: "/askYoursManage",
    name: "/askYoursManage",
    component: () => import("../views/askYoursManage/index")
  },
  {
    path: "/leaseMyManage",
    name: "/leaseMyManage",
    component: () => import("../views/leaseMyManage/index")
  },
  {
    path: "/leaseYoursManage",
    name: "/leaseYoursManage",
    component: () => import("../views/leaseYoursManage/index")
  }
];

const router = new VueRouter({
  mode: "history",
  base: process.env.BASE_URL,
  routes
});

export default router;
